divide and conquer strategy algorithm